package com.huaxin.device.models;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.huaxin.hxenum.enums.DeviceType;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 设备型号
 **/
@Data
@TableName("device_models")
@EqualsAndHashCode(callSuper = true)
public class DeviceModel extends BaseModel {

    /**
     * 型号编码
     */
    @TableField(value = "model_code")
    @Schema(description = "型号编码", example = "CB-2023A")
    private String modelCode;

    /**
     * 设备类型
     */
    @TableField(value = "device_type")
    @Schema(description = "设备类型", example = "circuit_breaker")
    private DeviceType deviceType;

    /**
     * 设备默认命名模板
     */
    @TableField(value = "device_name_template")
    @Schema(description = "设备默认命名模板", example = "{zone}断路器{no}")
    private String deviceNameTemplate;

    /**
     * 预期寿命（月）
     */
    @TableField(value = "expected_lifespan_months")
    @Schema(description = "预期寿命（月）", example = "60")
    private Integer expectedLifespanMonths;

    /**
     * 描述
     */
    @TableField(value = "description")
    @Schema(description = "描述", example = "高性能断路器，适用于厨房电路")
    private String description;

    /**
     * 技术参数（JSON）
     */
    @TableField(value = "specs")
    @Schema(description = "技术参数", example = "{\"rated_current\": \"20A\", \"protocol\": \"Modbus\"}")
    private String specs;

    /**
     * 组织家族ID
     */
    @TableField(value = "family_id")
    @Schema(description = "组织家族ID", example = "f3b2f8e1-4c5d-4e6f-8b2a-1c2d3e4f5a6b")
    private String familyId;
}